<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBlindBoxItemsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('blind_box_items', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('blind_box_id')->index()->comment('肓盒商品ID');
            $table->bigInteger('product_id')->index()->comment('商品ID');
            $table->bigInteger('product_token_id')->index()->comment('商品存证记录ID');
            $table->integer('sequence')->comment('排序');
            $table->string('status', 16)->default(\App\Enums\TokenStatus::INIT)->comment('状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('blind_box_items');
    }
}
